Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Creating Custom Object Subclasses

In QuickDraw 3D 1.5 and later releases, the object system is extensible. This lets you increase functionality in certain supported areas by adding plug-in subclasses to QuickDraw 3D's native classes. The three types of plug-ins currently supported are:

Element and attribute plug-ins let you share custom elements and attributes easily between applications. For example, you may wish to tag a geometry with a string, using a 'name' attribute. Previously, you would publish the format of the attribute or element, but this meant that each application had to reimplement the code, leading to incompatibility between different versions of custom attributes. With plug-ins, one set of elements and attributes can be shared.

Plug-in groups add powerful new capabilities. There may be times when an application needs to configure a group in a way that is not currently support by QuickDraw 3D. For example, you may wish to store references to light objects along with the geometric objects used to denote those lights, as in an interior design package where you may want to keep a light object together with a geometric model representing an angle-poised lamp. As the user manipulates the position of the lamp, the application wants to have easy access to the associated QuickDraw 3D light objects. For this purpose you can create a custom group that adds the lights. Another kind of plug-in group would be a level-of-detail group that changes the geometry of an object as the object changes its distance from the camera.

Plug-in renderers are interesting for developers because it is likely that there will be an end-user market for them as standalone products. Renderers require complex software design, but a quantity of technical literature is available to shorten your learning curve. Plug-in renderers are discussed in "Renderer Objects."

You can create and use a subclass of any group, renderer, element, or attribute object class in the QuickDraw 3D hierarchy. The methods and routines described in this section let you integrate your own objects of these types with the rest of QuickDraw 3D as fully-featured objects.

Custom Class Metahandlers

Object Types and Names

Data Structures Associated With a Class

Registering a Custom Class

Registering a Shared Library

Creating a Hierarchy

Object Methods

Class Routines

Class Methods


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |